import { createStore, applyMiddleware } from '@/redux';
import logger from 'redux-logger';
import thunk from 'redux-thunk';
// import { thunk } from '@/redux';
import promise from 'redux-promise';
// import { promise } from '@/redux';
import reducers from './reducers'
const store = applyMiddleware()(createStore)(reducers)
// const store = applyMiddleware(thunk, promise, logger)(createStore)(reducers)
// const store = applyMiddleware(one, two, three)(createStore)(reducers)
export default store;




function one(store) {
    console.log('1. one');
    return function (next) {
        console.log('2. one');
        return function (action) {
            console.log('3. one')
            next(action);
        }
    }
}
function two(store) {
    console.log('1. two');
    return function (next) {
        console.log('2. two');
        return function (action) {
            console.log('3. two');
            next(action);
        }
    }
}
function three(store) {
    console.log('1. three');
    return function (next) {
        console.log('2. three');
        return function (action) {
            console.log('3. three');
            next(action);
        }
    }
}

// 1. one
// 1. two
// 1. three
// 2. three
// 2. two
// 2. one